package com.hust360.percent.pojo;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public abstract class Appraise implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -8065575624453992514L;
	/**
	 * 评论的id
	 */
	public Long id;
	public static final String ID = "id";
	
	/**
	 * 打折信息的id
	 */
	public Long dscid;
	public static final String DSCID = "dscid";
	
	/**
	 * 发出评论的用户的id
	 */
	public Long uid;
	public static final String UID = "uid";
	
	/**
	 * 评论的内容
	 */
	public String content;
	public static final String CONTENT = "content";
	
	/**
	 * 用户打分的分数 0 - 5
	 */
	public Float rate;
	public static final String RATE = "rate";
	
	public static final String[] COLUMNS = {ID, DSCID, UID, CONTENT, RATE};
	
	/**
	 * 获取对应的打折信息对象
	 */
	public abstract Discount getDiscount();
	
	/**
	 * 获取对应的发出评论的用户
	 */
	public abstract User getUser();
	
	/**
	 * 获取评论的接口 
	 * @author yangyang
	 */
	
	public static interface AppraiseDAO {
		
		/**
		 * 根据id获取评论 
		 */
		public Appraise findById(Long id);
		
		/**
		 * 根据一个map获取一个评论的list
		 */
		public List<Appraise> findWithMap (Map<String, String> map);
		
	}
	
}
